import request from '@/utils/request'
import scope from '../scope'
const apiPrefix = `${process.env.VUE_APP_BASE_API}/${scope}/LowCodeTable/`

// 低代码管理
export const getLowCodeTable = (params, config = {}) => {
    return request.get(apiPrefix + params.id, params, config)
}
export const addLowCodeTable = (params, config = {}) => {
    return request.post(apiPrefix, params, config)
}
export const getLowCodeTableListPage = (params, config = {}) => {
    return request.post(apiPrefix + 'page-list', params, config)
}
export const getTableEntityList = (params, config = {}) => {
    return request.get(apiPrefix + 'table-entity-list', params, config)
}
export const getColumnListByTableName = (params, config = {}) => {
    return request.get(apiPrefix + 'table-column-name-list', { params: params, config })
}
export const removeLowCodeTable = (params, config = {}) => {
    return request.delete(apiPrefix + params.id, { params: params, ...config })
}
export const batchLowCodeTable = (params, config = {}) => {
    return request.delete(apiPrefix + 'ids', { data: params, ...config })
}
export const editLowCodeTable = (params, config = {}) => {
    return request.put(apiPrefix, params, config)
}
export const generateLowCodeTable = (params, config = {}) => {
    return request.post(apiPrefix + 'generate-code/' + params.id, params, config)
}
export const generateView = (params, config = {}) => {
    return request.post(apiPrefix + 'generate-view/' + params.id, params, config)
}